package com._54programer.ioc.config.config.register;

import com._54programer.ioc.config.beans.register.Person;
import com._54programer.ioc.config.condition.WindowsCondition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

//类中组件统一设置。满足当前条件，这个类中配置的所有bean注册才能生效
@Conditional(WindowsCondition.class)
@Configuration
public class BeanConfig4 {

    //按照一定的条件进行判断，满足条件给容器中注册bean
    //@Conditional(LinuxCondition.class)
    @Bean
    public Person person(){
        return new Person("张三", 11);
    }

}
